<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body{
        background-color: black;
    }
    .box{
        height: 200px;
        width: 200px;
      
        position: relative;
        transform-style: preserve-3d;
        margin: 0 auto;
        margin-top: 100px ;
        animation: zhuan 1s infinite linear;
       
        
    }
    .box1{
        width: 200px;
        height: 200px;
        position: absolute;
        left: 0;
        top: 0;
        transition: 1s;
    }
    .box1:nth-child(1){
        color: palevioletred;
        box-shadow: 0 0 20px blanchedalmond;
        transform: rotateX(90deg) translateZ(-100px);
    }
    .box1:nth-child(2){
        color: paleturquoise;
        box-shadow: 0 0 20px yellowgreen;
        transform: rotateX(90deg) translateZ(100px);
    }
    .box1:nth-child(3){
        color: pink;
        box-shadow: 0 0 20px blueviolet;
        transform: rotateY(90deg) translateZ(-100px);
    }
    .box1:nth-child(4){
        color: purple;
        box-shadow: 0 0 20px blueviolet;
        transform: rotateY(90deg) translateZ(100px);
    }
    .box1:nth-child(5){
        color: red;
        box-shadow: 0 0 20px pink;
        transform: translateZ(-100px);
    }
    .box1:nth-child(6){
        color: blueviolet;
        box-shadow: 0 0 20px blueviolet;
        transform: translateZ(100px);
    }
   .box:hover .box1{
       background-color: currentColor;
       box-shadow: 0 0 100px currentColor;
   }
    @keyframes zhuan{
        0%{
            transform: rotateX(0) rotateY(0) ;
      
        }
        100%{
            transform: rotateX(360deg) rotateY(360deg);
           
        }
    }

</style>
<body>
    <div class="box">
        <div class="box1"></div>
        <div class="box1"></div>
        <div class="box1"></div>
        <div class="box1"></div>
        <div class="box1"></div>
        <div class="box1"></div>
    </div>
</body>
</html>